package leetcode.code343;

public class Solution extends Solution343 {

	@Override
	public int integerBreak(int n) {
		if (n == 2)
			return 1;
		if (n == 3)
			return 2;
		int n3 = n / 3;// 2 1
		int m3 = n % 3;// 2 0
		if (m3 == 2) {
			return (int) Math.pow(3, n3) * 2;
		} else if (m3 == 0) {
			return (int) Math.pow(3, n3);
		} else if (m3 == 1) {
			return (int) Math.pow(3, n3 - 1) * 4;
		}
		return -1;
	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug1();
		so.debug2();
//		System.out.println(1 << 0);
		System.out.println(Math.pow(3, 1));
		System.out.println(Math.pow(3, 2));
		System.out.println(Math.pow(3, 3));
		System.out.println(Math.pow(3, 4));

	}

}
